package org.vergil.config;

import org.springframework.beans.factory.config.PropertyPlaceholderConfigurer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;

@Configuration
@ComponentScan(value = "org.vergil")
//@EnableAspectJAutoProxy//开启aop注解
public class RootConfig {

    @Bean
    public PropertyPlaceholderConfigurer propertyPlaceholderConfigurer() {
        PropertyPlaceholderConfigurer configurer = new PropertyPlaceholderConfigurer();
        Resource resource = new ClassPathResource("config.properties");
        configurer.setLocations(resource);
        configurer.setFileEncoding("UTF-8");
        return configurer;
    }
}
